
<!DOCTYPE html>
<html>

<head>
    <title>打卡签到</title>
    <meta charset="utf-8"/>
    <meta http-equiv="refresh" content="900">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <style>
        html, body {
            height: 95%;
            border:none;
            text-align: center;
        }

        table {
            width: 100%;
            height: 100%;
            border:none;
            text-align: center;
        }

        .curriculum_title {
            width: 100%;
            height: 15%;
        }

        .curriculum_body {
            width: 100%;
            height: 85%;
        }

        .qrcode-footer {
            border:none;
            text-align: center;
            padding-bottom: 5px;
            bottom: 0px;
            position: absolute;
            width: 95%;
        }

        .qrcode-switch {
            border:none;
            text-align: right;
            padding-bottom: 10px;
            position: absolute;
            bottom: 5px;
            width: 98%;
            display:none;
        }

        iframe {
            height: 120%;
            width: 100%;
            border:none;
        }

        td {
            border:none;
            text-align: center;
        }

        th {
            border: 5px;
        }

        .countdown {
            color:#b43f2b;
        }

        .ifame-body {
            width: 100%;
            height: 120%;
            margin: 0px auto;
            max-width: 360px;
            text-align: center;
        }


        .qrcode_title {
            font-size: xx-large;
            color: black;
        }

    </style>
    <script src="/assets/expand/plugins/jquery/jquery-3.2.1.min.js"></script>
    <script>
        if (window != top)
            top.location.replace(location.href);

        $(function(){
            var now = new Date();
            // var end = new Date(2021,9,13,18,30,00);//结束的时间：年，月，日，分，秒（月的索引是0~11）
            var end = new Date('2023-12-20 23:44:46');
            /*两个时间相减,得到的是毫秒ms,变成秒*/
            var result = Math.floor(end - now) / 1000;

            console.log("result=" + result);

            var interval=setInterval(sub,1000); //定时器 调度对象
            /*封装减1秒的函数*/
            function sub(){
                if (result > 1) {
                    result = result - 1;
                    var second = Math.floor(result % 60);     // 计算秒 ，取余
                    var minite = Math.floor((result / 60) % 60); //计算分 ，换算有多少分，取余，余出多少秒
                    var hour = Math.floor((result / 3600) % 24); //计算小时，换算有多少小时，取余，24小时制除以24，余出多少小时
                    var day = Math.floor(result / (3600*24));  //计算天 ，换算有多少天

                    var msg = hour + "小时" + minite + "分" + second + "秒";
                    if (day > 0)
                        msg = day + "天" + msg;
                    $(".countdown").html(msg);
                } else{
                    var date=new Date();
                    var year=date.getFullYear(); //获取当前年份
                    var mon=date.getMonth()+1; //获取当前月份
                    var da=date.getDate(); //获取当前日
                    var day=date.getDay(); //获取当前星期几
                    var h=date.getHours(); //获取小时
                    var m=date.getMinutes(); //获取分钟
                    var s=date.getSeconds(); //获取秒
                    var days=new Array("星期日","星期一","星期二","星期三","星期四",	"星期五","星期六");
                    var msg = days[day]+'<br>'+year+'年'+mon+'月'+da+'日'+' '+h+':'+m+':'+s;
                    $(".countdown").html(msg);
                    //window.clearInterval(interval);//这里可以添加倒计时结束后需要执行的事件
                }
            };
        });
    </script>
</head>

<body>


<table class="curriculum_body" frame=void>
    <tr height="60%">
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
    </tr>
    <tr height="60%">
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
        <td><div class="ifame-body"><iframe src="/qrcode?state=${state}"></iframe></div></td>
    </tr>
</table>
</body>
</html>